<%@ Page Title="" Language="C#" MasterPageFile="~/RentAWorkerMaster.master" Inherits="System.Web.Mvc.ViewPage<RentAWorker.Business.DTO.RentalServiceRequest>" 
Culture="auto" UICulture="auto"
%>

<script runat="server">
    
    protected void Page_PreInit(object sender, EventArgs e)
    {
        if (Session["Theme"] != null)
            this.Theme = Session["Theme"].ToString();
    }
    
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
	<title>Request</title>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="RightPlaceholder" runat="server">

     <!-- http://www.codeplex.com/AjaxControlToolkit/Release/ProjectReleases.aspx?ReleaseId=16488 -->
     <link href="../../Content/AjaxControlToolkit/3.0.20820.16598/3.0.20820.0/AjaxControlToolkit.Calendar.Calendar.css"   rel="stylesheet" type="text/css" />  
     <script src="../../Content/MicrosoftAjax.debug.js" type="text/javascript"></script>  
     <script src="../../Content/AjaxControlToolkit/3.0.20820.16598/3.0.20820.0/AjaxControlToolkit.ExtenderBase.BaseScripts.js"           type="text/javascript"></script>  
     <script src="../../Content/AjaxControlToolkit/3.0.20820.16598/3.0.20820.0/AjaxControlToolkit.Common.Common.js"           type="text/javascript"></script>  
     <script src="../../Content/AjaxControlToolkit/3.0.20820.16598/3.0.20820.0/AjaxControlToolkit.Common.DateTime.js"          type="text/javascript"></script>  
     <script src="../../Content/AjaxControlToolkit/3.0.20820.16598/3.0.20820.0/AjaxControlToolkit.Animation.Animations.js"           type="text/javascript"></script>  
     <script src="../../Content/AjaxControlToolkit/3.0.20820.16598/3.0.20820.0/AjaxControlToolkit.PopupExtender.PopupBehavior.js"           type="text/javascript"></script>  
     <script src="../../Content/AjaxControlToolkit/3.0.20820.16598/3.0.20820.0/AjaxControlToolkit.Animation.AnimationBehavior.js"           type="text/javascript"></script>  
     <script src="../../Content/AjaxControlToolkit/3.0.20820.16598/3.0.20820.0/AjaxControlToolkit.Common.Threading.js"           type="text/javascript"></script>  
     <script src="../../Content/AjaxControlToolkit/3.0.20820.16598/3.0.20820.0/AjaxControlToolkit.Compat.Timer.Timer.js"         type="text/javascript"></script>  
     <script src="../../Content/AjaxControlToolkit/3.0.20820.16598/3.0.20820.0/AjaxControlToolkit.Calendar.CalendarBehavior.js"           type="text/javascript"></script>      
     <script type="text/javascript">  
   
         Sys.Application.add_init(appInit);  
   
         function appInit()   
         {
             $create(AjaxControlToolkit.CalendarBehavior, { "format": "dd.MM.yyyy" }, null, null, $get('FromDate'));
             $create(AjaxControlToolkit.CalendarBehavior, { "format": "dd.MM.yyyy" }, null, null, $get('ToDate'));  
         }     
       
     </script>      
     
    <h2>Request</h2>

    <%= Html.ValidationSummary() %>
    
    <% if (ViewData.ModelState.IsValid)
       { %>
            <p><%= TempData["Error"] ?? string.Empty  %></p>
    <% } %>
    
    <% using (Html.BeginForm()) {%>

        <fieldset>
            <legend>Fields</legend>
            <p>
                <label for="FromDate">FromDate:</label>
                <%= Html.TextBox("FromDate",DateTime.Now.ToShortDateString()) %>
                <%= Html.ValidationMessage("FromDate", "*") %>
            </p>
            <p>
                <label for="ToDate">ToDate:</label>
                <%= Html.TextBox("ToDate", DateTime.Now.AddDays(7).ToShortDateString())%>
                <%= Html.ValidationMessage("ToDate", "*") %>
            </p>
            <p>
                <label for="LocationId">Location:</label>
                <%= Html.DropDownList("LocationId", 
                             (IEnumerable<SelectListItem>)ViewData["LocationListItems"]) %>
            </p>
            <p>
                <input type="submit" value="Request" />
            </p>
        </fieldset>

    <% } %>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="LeftPlaceholder" runat="server">
</asp:Content>

